<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Job_model extends MY_Model
{

	public function getJobList(){
        $sql = "SELECT * FROM ym_jobs  ORDER BY sort_order DESC";
        $query = $this->db->query($sql);
        $result =$query->result_array();
        return $result;
    }


    

     //编辑
    public function editJob($id,$data = array()){
        if($id){
            $this->db->where("id",$id);
            $res = $this->db->update("ym_jobs",$data);
        }else{
            $res = $this->db->insert("ym_jobs",$data);
        }
        return $res;
    }

     public function delJob($id){
        $this->db->where("id",$id);
        $res = $this->db->delete("ym_jobs");
        return $res;
    }

     //根据id获取广告信息
    public function getJobInfobyID($id){
        $this->db->where("id",$id);
        $query = $this->db->get("ym_jobs");
        return $query->row_array();
    }

}


